package atlantik.game;

import modelz.ObjectFactory;
import modelz.ui.PeerFactory;
import atlantik.game.action.AtlantikActionFactory;
import atlantik.game.action.AtlantikClientAction;
import atlantik.game.action.ConnectAction;
import atlantik.game.action.DisconnectAction;
import atlantik.game.action.JailCardAction;
import atlantik.game.action.JailPayAction;
import atlantik.game.action.JailRollAction;
import atlantik.game.action.LeaveGameAction;
import atlantik.game.action.RollAction;
import atlantik.game.action.StartGameAction;

public interface Atlantik extends ObjectFactory, PeerFactory {

	public enum Action implements AtlantikActionFactory<AtlantikClientAction> {
		CONNECT {
			public AtlantikClientAction getActionInstance(Atlantik client) {
				return new ConnectAction(client);
			}
		}, DISCONNECT {
			public AtlantikClientAction getActionInstance(Atlantik client) {
				return new DisconnectAction(client);
			}
		}, START_GAME {
			public AtlantikClientAction getActionInstance(Atlantik client) {
				return new StartGameAction(client);
			}
		}, LEAVE_GAME {
			public AtlantikClientAction getActionInstance(Atlantik client) {
				return new LeaveGameAction(client);
			}
		}, ROLL {
			public AtlantikClientAction getActionInstance(Atlantik client) {
				return new RollAction(client);
			}
		}, JAIL_PAY {
			public AtlantikClientAction getActionInstance(Atlantik client) {
				return new JailPayAction(client);
			}
		}, JAIL_ROLL {
			public AtlantikClientAction getActionInstance(Atlantik client) {
				return new JailRollAction(client);
			}
		}, JAIL_CARD {
			public AtlantikClientAction getActionInstance(Atlantik client) {
				return new JailCardAction(client);
			}
		}
		;
	}

	boolean isConnected();

	void connect();

	void disconnect();

	AtlantikState getState();

	void setName(String name);

	void reconnect(String cookie);

	void setImage(String name);

	void newGame(String gameType);

	void join(Game game);

	void leaveGame();

	// Administrator only
	void updateOption(Game.Option option);

	void startGame();

	void kickPlayer(Player player);

	void chat(String msg);

	void command(String command);

	void rollDice();

	void buyEstate();

	void endTurn();

	void auctionEstate();

	void auctionBid(Auction auction, int amount);

	void tokenConfirmation(Estate estate);

	void estateToggleMortgage(Estate estate);

	void estateHouseBuy(Estate estate);

	void estateHouseSell(Estate estate);

	void newTrade(Player player);

	void tradeUpdateEstate(Trade trade, Estate estate, Player player);

	void tradeUpdateMoney(Trade trade, int money, Player pFrom, Player pTo);

	void tradeReject(Trade trade);

	void tradeAccept(Trade trade);

	void jailPay();

	void jailRoll();

	void jailCard();

}
